﻿using StarryEdge.Core;
using StarryEdge.Core.Attributes;
using StarryEdge.Core.Device;
using StarryEdge.Core.Models;
using StarryEdge.Core.Parameter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StarryEdge.Module.Handle.Handle
{
    [TaskClass("设备状态")]
    public class DeviceStatus<T> : HandleBase, IHandle<T>
    {
        public DeviceStatus(IStarryEdgeLog starryEdgeLog, IDialogHost dialogHost, ITemporaryParameter temporaryParameter, ISystemConfigParameter systemConfigParameter, IDeviceFactory deviceFactory) : base(starryEdgeLog, dialogHost, temporaryParameter, systemConfigParameter, deviceFactory)
        {
        }

        public Task<bool> Handle(HandleContext<T> context)
        {
            _log.LogRun($"当前设备状态：{_temporary.GetStatusDevices()[context.ServiceName]}", Core.Enums.LogLevel.Info);
            return Task.FromResult(true);
        }
    }
}
